// relocates party somewhere in the same layer. no flashy fx

// Cell 0,1 - Coordinates to take to
// Cell 2 - Direction to appear from (0 - from north, 1 - west, 2 - south, 3 - east), UNUSED
// Cell 3,4 - A stuff done flag. If one is given, this flag must be nonzero to let party use stairs/
// Cell 5 - If the flag prevent party from using teleport, starts a convo at this node.

beginobjectscript; // talking object

variables;

body;

beginstate INIT_STATE;
	break;

beginstate DEAD_STATE;
	break;

beginstate START_STATE; 
	break;

beginstate USE_STATE;
	if (is_combat()) {
		print_str_color("You can't use this when you are in combat.",2);
		end();
		}

	if ((get_memory_cell(3) > 0) || (get_memory_cell(4) > 0)) {
		if (get_sdf(get_memory_cell(3),get_memory_cell(4)) == 0) {
			begin_talk_mode(get_memory_cell(5));
			}
		}

	// if portal add spell effect
	//if (object_type(ME) == ?)
	
	teleport_party(get_memory_cell(0),get_memory_cell(1),0);

break;
